using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BOOM : MonoBehaviour
{
    public float Atk_Player;
    public float Atk_Enemy;

    public float TrapMagicTime = 0.2f;

    // Start is called before the first frame update
    void Start()
    {
        Collider collider = GetComponent<Collider>();
        Destroy(collider, TrapMagicTime);
        Destroy(gameObject, 1f);
    }

    // Update is called once per frame
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Player")
        {
           other.gameObject.GetComponent<Player_Control>().GetHurt(Atk_Player);
        }

        if (other.gameObject.tag == "Enemy")
        {
            other.gameObject.GetComponent<Enemy_GetHurt>().GetHurt(Atk_Enemy);
        }
    }
}
